﻿using System;

namespace SPSiteColumnUsage
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                if(args.Length != 2)
                {
                    Console.WriteLine("You must specify two arguments");
                    Console.WriteLine("- url of a SharePoint site");
                    Console.WriteLine("- name of a site column");
                    Console.WriteLine("");
                    Console.WriteLine("Usage:");
                    Console.WriteLine("SPSiteColumnUsage.exe [url] [sitecolumnName]");
                    Console.WriteLine("");
                    Console.WriteLine("Example:");
                    Console.WriteLine("SPSiteColumnUsage.exe http://demosite Title");
                }
                else
                {
                    //Display al site column usage information.
                    Sample.Run(args[0], args[1]);                    
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("*** EXCEPTION: {0}", ex);                    
            }
        }
    }
}
